<!DOCTYPE html>
<html>
	<head lang="en">
		<meta charset="UTF-8">
		<title>课工场论坛列表</title>
		<link href="css/bbs.css" rel="stylesheet">
	</head>
	<body>
		<div class="bbs">
			<header><span onclick="post(this)">我要发帖</span></header>
			<section>
				<ul id="postList">
					<li>
						<div><img src="images/tou02.jpg"></div>
						<h1>ggggg</h1>
						<p><span>版块：新手报到</span><span>发表时间：2019-11-18 17:28</span></p>
					</li>
					<li>
						<div>
							<img src="images/tou01.jpg"></div>
						<h1>ddddd</h1>
						<p><span>版块：新课来了</span><span>发表时间：2019-11-18 17:27</span></p>
					</li>
				</ul>
			</section>

			<div class="post">
				<input class="title" name="ff" placeholder="请输入标题（1-50个字符）">
				所属版块：<select>
					<option>请选择版块</option>
					<option>电子书籍</option>
					<option>新课来了</option>
					<option>新手报到</option>
					<option>职业规划</option>
				</select>
				<textarea class="content"></textarea>
				<input class="btn" value="发布" onclick="bth(this)">
			</div>
		</div>
		<script >
			function post(t){
			var b=t.parentNode.nextElementSibling.nextElementSibling;
			b.style.display="block";
			};
			function bth(t){
				var aa=document.getElementsByName("ff");
				var bb=aa[0].value;
				var cc=aa[0].nextElementSibling.value;
				var dd=aa[0].parentNode;
				dd.style.display="none";
				var li1=document.createElement("li");
				var div1=document.createElement("div");
				var img1=document.createElement("img");
				var h11=document.createElement("h1");
				var p1=document.createElement("p");
				var span1=document.createElement("span");
				var span2=document.createElement("span");
				
				
				li1.appendChild(div1);
				div1.appendChild(img1);
				li1.appendChild(h11);
				li1.appendChild(p1);
				p1.appendChild(span1);
				p1.appendChild(span2);
				
			var ul1	=dd.previousElementSibling.firstElementChild;
			ul1.appendChild(li1);
			
			img1.setAttribute("src","./images/tou02.jpg")
			h11.innerHTML=bb;
			span1.innerHTML="板块："+cc;
			var d=new Date();
			
			span2.innerHTML="发表时间："+d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate()+" "+d.getHours()+":"+d.getMinutes();
			};
		</script>
	</body>
</html>
